// 
//  Copyright 2011  comphilip
// 
//    Licensed under the Apache License, Version 2.0 (the "License");
//    you may not use this file except in compliance with the License.
//    You may obtain a copy of the License at
// 
//        http://www.apache.org/licenses/LICENSE-2.0
// 
//    Unless required by applicable law or agreed to in writing, software
//    distributed under the License is distributed on an "AS IS" BASIS,
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//    See the License for the specific language governing permissions and
//    limitations under the License.
using System;
namespace Dict4Engkoo.Result {
	/// <summary>
	/// Utility to create common DICT responses.
	/// </summary>
	static internal class CommonResults {
		/// <summary>
		/// Gets command not recognized response
		/// </summary>
		public static IResult CommandNotRecognized{
			get{
				return new StatusTextResponse(500, StatusArgument.CreateRawStringArgument(Strings.CommandNotRecognized));
			}
		}
		
		/// <summary>
		/// Get illegal parameters response
		/// </summary>
		public static IResult IllegalParameters{
			get{
				return new StatusTextResponse(501, StatusArgument.CreateRawStringArgument(Strings.IllegalParameters));
			}
		}
		
		/// <summary>
		/// Gets command not implemented response
		/// </summary>
		public static IResult CommandNotImplemented {
			get{
				return new StatusTextResponse(502, StatusArgument.CreateRawStringArgument(Strings.CommandNotImplemented));
			}
		}
		
		/// <summary>
		/// Gets command parameter not implemented response
		/// </summary>
		public static IResult CommandParameterNotImplemented{
			get{
				return new StatusTextResponse(503, StatusArgument.CreateRawStringArgument(Strings.CommandParameterNotImplemented));
			}
		}
		
		/// <summary>
		/// Gets OK response
		/// </summary>
		public static IResult OK{
			get{
				return new StatusTextResponse(250, StatusArgument.CreateRawStringArgument("OK"));
			}
		}
		
		/// <summary>
		/// Create a internal server error response
		/// </summary>
		/// <param name="Exp">A <see cref="Exception"/> to create dict reponse</param>
		/// <returns>A 400 dict response</returns>
		public static IResult FormatException(Exception Exp){
			return new StatusTextResponse(400, StatusArgument.CreateRawStringArgument(Exp.Message));
		}
	}
}

